﻿@model EntryController.ShowModel
@{
    ViewBag.Title = Model.Title + " | " + Model.Config.Heading;
}

<article class="entry">
    @if (Model.User.IsAdmin)
    {
        <div class="admin-box text-links">
            Admin:
            @Html.ActionLink("Edit", "Edit", "Entry", new { id = Model.Slug }, null) |
            @Html.ActionLink("Delete", "Delete", "Entry", new { id = Model.Slug }, null)
        </div>
    }
    
    <h1>@Model.Title</h1>
    
    <div class="text-links">
        @Html.Safe(@Model.Html)
    </div>

    <div class="entry-date">
        @Model.Date
    </div>

    <p>
        @Html.ActionLink("Read more posts »", "Index", "Home")
    </p>

    @if (!string.IsNullOrWhiteSpace(@Model.Config.Disqus.Shortname))
    {
    <div id="disqus_thread"></div>
    <script type="text/javascript">

        var disqus_shortname = '@Model.Config.Disqus.Shortname';
        var disqus_developer = @(Model.Config.Disqus.DevelopmentMode ? "1" : "0");
        var disqus_identifier = '@Model.Slug';
        var disqus_title = '@Model.Title';

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function () {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    <a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
    }
    
</article>

@section Scripts {
    @if (Model.IsCodePrettified)
    {
    <script>
        $(function () {
            prettyPrint();
        });
    </script>
    }
}